home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 September / macformat-004.iso / Demos / Asymptote / Examples / Utility Scripts / addgaussian next >
Encoding:
Text File  |  1994-06-15  |  472 b   |  17 lines  |  [TEXT/DWat]

  1. % addgaussian amplitude center widthFWHM
  2.  
  3. % Add a gaussian to the y vector
  4.  
  5. % ARGUMENTS:
  6. %        amplitude    -- amplitude of the Gaussian
  7. %        center        -- center of Gaussian (in x)
  8. %        widthFWHM    --    full width at 1/2 maximum
  9. %
  10. % DSECRIPTION:
  11. % Add a Gaussian function to the current y values.  Use a negative
  12. % amplitude to subtract a Gaussian.
  13.  
  14. % Note: This script could also be a macro since
  15. %       it takes only 1 line
  16.  
  17. rpn <x &2 - &3 2 ln sqrt 2 * / / dup * -1 * e^x &1 * <y + >y